// 基于下面的代码，完成后续的四个练习
class Container {
    static of(value) {
        return new Container(value)
    }
    constructor(value) {
        this._value = value
    }
    map(fn) {
        return Container.of(fn(this._value))
    }
}

class Maybe {
    static of(value) {
        return new Maybe(value)
    }
    
    constructor(value) {
        this._value = value
    }

    isNothing() {
        return this._value === null || this._value === undefined
    }

    map(fn) {
        return this.isNothing() ? this : Maybe.of(fn(this._value))
    }
}

module.exports = {Maybe, Container}

//1.使用fp.add(x,y) fp.map(f,x) 创建一个能让functor里的值增加的函数ex1
const fp = require('lodash/fp')
const { Maybe,Container} = require('./support')
let maybe = Maybe.of([5,6,1])
let ex1 = () =>{
      
}